import platform
import os.path
import sys
import os

__all__ = [
	"SYSTEM",
	"DADDY_DIR",
	"EXEC_FILE_LIST",
	"EXEC_FILE_ATTR",
	"EXEC_DIR",
	"PKG_LIST",
	"PKG_DIR",
	"PKG_DIR_ATTR",
	"NORM_FILE_ATTR"
]

# System platform.
SYSTEM = platform.system()

# Install directories.
if SYSTEM == 'Windows':
	C = os.environ["homedrive"]
	PYTHON_DIR = C + "\\Python2" + str(sys.version_info.minor) + "\\"
	EXEC_DIR = PYTHON_DIR
	if os.path.exists(PYTHON_DIR + "Lib\\site-packages\\"):
		PKG_DIR = PYTHON_DIR + "Lib\\site-packages\\"
	elif os.path.exists(PYTHON_DIR + "Lib\\dist-packages\\"):
		PKG_DIR = PYTHON_DIR + "Lib\\dist-packages\\"
	else:
		PKG_DIR = PYTHON_DIR
elif SYSTEM == 'Linux':
	EXEC_DIR = "/usr/bin/"
	PYTHON_DIR = "/usr/lib/python2." + str(sys.version_info.minor) + "/"
	if os.path.exists(PYTHON_DIR + "dist-packages/"):
		PKG_DIR = PYTHON_DIR + "dist-packages/"
	elif os.path.exists(PYTHON_DIR + "site-packages/"):
		PKG_DIR = PYTHON_DIR + "site-packages/"
	else:
		PKG_DIR = PYTHON_DIR
else:
	EXEC_DIR = None
	PKG_DIR = None

# daddy directory
DADDY_DIR	= ".." + os.sep + "daddy" + os.sep

# Execuitable files.
EXEC_FILE_LIST	= ["daddy.py", "listpath.py", "sync.py"]

# Packages list.
PKG_LIST = ["lts", "daddyparsers"]

# Execuitable files permission.
EXEC_FILE_ATTR	= 0777

# Attributes for normal files.
NORM_FILE_ATTR	= 0666

# Attributes for pkg-directories
PKG_DIR_ATTR	= 0777
